<template>
  <div>
    <h1>{{count}}</h1>
    <button @click = "count++">累加</button>
    <button @click = "remove">卸载</button>
  </div>
</template>

<script>
export default {
  name: "Child",
  props:["count"],

  methods:{
    remove(){
      //卸载组件
      this.$destroy()
    }
  },


  beforeCreate(){
    console.log("----beforeCreate----")
  },

  created(){
    console.log("----created----")
  },

  beforeMount(){
    console.log("----beforeMount----")
  },

  mounted(){
    console.log("----mounted----")
  },


  beforeUpdate(){
    console.log("----beforeUpdate----")
  },

  updated(){
    console.log("----updated----")
  },

  beforeDestroy(){
    console.log("----beforeDestroy----")
  },

  destroyed(){
    console.log("----destroyed----")
  },


}
</script>

<style>

</style>